import { myRequest } from '@/utils/request.js'

// 技能认证类目列表	
export const getSkillData = () =>{
	return myRequest({
		url: '/mallapi/skillCertificationCategory/tree',
		method: 'get',
		showLoading: false
	});
}

//通过id查询技能认证类目
export const getSkillCategory = (id) => {
	
	return myRequest({
		url: `/mallapi/skillCertificationCategory/getSkillById/${id}`,
		method: 'get',
		showLoading: false
	})
	
}

//技能认证申请

export const getSkilAuthentication = (data) => {
	return myRequest({
		url: '/mallapi/skill/applyFor',
		method: 'post',
		data,
		showLoading: false
	})
}

//技能认证详情

export const getdetailsData = () => {
	return myRequest({
		url: '/mallapi/skill/page',
		method: 'get',
		showLoading: false
		
	})	
}

// 技能认证失败原因
export const getFail = (id) => {
	return myRequest({
		url: `/mallapi/skill/${id}`,
		method: 'get',
		showLoading: false
	})
}

//工单列表
export const getSkllWork = (data) => {
	return myRequest({
		url: '/mallapi/workOrder/list',
		method: 'get',
		data,
		showLoading: false 
	})
}


// 工单权限

export const getSkillAuthority = (id) => {
	return myRequest({
		url: `/mallapi/skill/getByUserId/${id}`,
		method: 'get',
		showLoading: false
	})
	
}

//领取工单
export const getCollectWorkOrder = (data) => {
	return myRequest({
		url: `/mallapi/workOrder/take/`,
		method: 'put',
		data,
		showLoading: false
	})
}

// 取消工单
export const getSkillCancellation = (data) => {
	return myRequest({
		url: `/mallapi/workOrder/cancel`,
		method: 'put',
		data,
		showLoading: false
	})
	
}

// 修改时间
export const getSkillEditTiem = (data) => {
	return myRequest({
		url: `/mallapi/workOrder/modifyServiceTime`,
		method: 'put',
		data,
		showLoading: false
	})
	
}

//通过id获取工单信息
export const getSkillWorkOrderId = (id) => {
	return myRequest({
		url: `/mallapi/workOrder/${id}`,
		method: 'get',
		showLoading: false
	})
	
}